var webpack = require('webpack');
var path = require("path");
module.exports = {
    //页面入口文件配置
    entry: {
        app: './app/src/app.js'
    },
    //入口文件输出配置
    output: {
        publicPath:"dist/Scripts/",
        path: 'dist/Scripts',
        filename: '[name].js',
        chunkFilename: '[chunkhash:8].chunk.js'
    },
    module: {
        //加载器配置
        loaders: [
            { test: /\.css$/, loader: 'style-loader!css-loader' },
            { test: /\.js$/, loader: 'jsx-loader?harmony' },
            { test: /\.less$/, loader: 'style!css!less?sourceMap' }
        ]
    },
    //其它解决方案配置
    resolve: {
        extensions: ['', '.js', '.json', '.less'],
        alias: {
            react: path.join(__dirname,"bower_components/react/react-with-addons.js"),
            reactdom: path.join(__dirname,"bower_components/react/react-dom.js")
        },
        root: [
            path.join(__dirname, "bower_components")
        ]
    },
    plugins: [
        new webpack.ResolverPlugin(
            new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin(".bower.json", ["main"])
        )
    ]
};